package org.example.com.exception;

import org.example.com.util.JsonResult;
import org.example.com.util.RecultTool;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalException {
    @ExceptionHandler(UserloginException.class)
    public JsonResult userloginException (Throwable e){
        return RecultTool.fail(5001,e.getMessage());
    }
    @ExceptionHandler(NotLoginException.class)
    public JsonResult notLoginException (Throwable e){
        return RecultTool.fail(5002,e.getMessage());
    }
}
